#pragma once
#include "MyShapes.h"
#include <string>
using namespace std;

class MyEffect : public MyShapes
{
protected:
	MyShapes* _shape;
	char _color[3];

public:
	MyEffect(void)
	{
		_shape = NULL;
	}

	~MyEffect(void)
	{
		// Khong duoc phep huy shape ben trong
		//delete _shape;	// Khong co dong nay
	}

	MyEffect(int x, int y, int width, int height, char stroke[], int strokeWidth, char fill[])
	{
	}

	/*MyEffect(MyShapes* containShape)
	{
		_shape = containShape;
	}*/

	void SetShape(MyShapes* shape)
	{
		_shape = shape;
	}

	void Fill(MyGraphics* g)
	{
	}

	void SetColor(char color[])
	{
		// Chi xet voi mang 3 phan tu
		for (int i = 0; i < 3; i++)
		{
			_color[i] = color[i];
		}
	}

	// Lay ten hieu ung
	virtual string GetName() = 0;

	virtual void DrawEffect(MyGraphics* g) = 0;

	virtual void Draw(MyGraphics* g)
	{
		if (_shape != 0)
		{
			// Day la cach pho bien, neu co 1 hieu ung nao do thi co the thay doi lai.

			// Ve hieu ung truoc
			DrawEffect(g);

			// Ve doi tuong duoc phu hieu ung
			_shape->Draw(g);
		}
	}
};

